package bg.btanev.eightyfour.client.presenter;

import bg.btanev.eightyfour.client.service.GWTCommandServiceAsync;

import com.google.gwt.event.shared.HandlerManager;


/**
 *
 * @author B.Tanev
 *
 */
public abstract class BasePresenter implements Presenter {
	private final Display display;

	@SuppressWarnings("unchecked")
	protected final GWTCommandServiceAsync rpcService;
	protected final HandlerManager eventBus;

	@SuppressWarnings("unchecked")
	protected BasePresenter(Display view, HandlerManager eventBus, GWTCommandServiceAsync rpcService) {
		this.display = view;
		this.eventBus = eventBus;
		this.rpcService = rpcService;

		bind();
	}

	@SuppressWarnings("unchecked")
	protected <D extends Display> D getDisplay() {
		return (D) this.display;
	}

	protected abstract void bind();
}
